Skip to main content
POST
/
v1
/
flux-2-klein-4b
Generate or edit an image with FLUX.2 [Klein 4B]
curl --request POST \
  --url https://api.bfl.ai/v1/flux-2-klein-4b \
  --header 'Content-Type: application/json' \
  --header 'x-key: <api-key>' \
  --data '
{
  "prompt": "ein fantastisches bild",
  "input_image": "<string>",
  "input_image_2": "<string>",
  "input_image_3": "<string>",
  "input_image_4": "<string>",
  "seed": 42,
  "width": 0,
  "height": 0,
  "safety_tolerance": 2,
  "output_format": "jpeg",
  "webhook_url": "<string>",
  "webhook_secret": "<string>"
}
'
{
  "id": "<string>",
  "polling_url": "<string>",
  "cost": 123,
  "input_mp": 123,
  "output_mp": 123
}

Authorizations

x-key
string
header
required

Body

application/json

Input model for FLUX.2 Klein (non-base) - like Pro but max 4 images.

prompt
string
required

Text prompt for image generation.

Example:

"ein fantastisches bild"

input_image
string | null

Path to the input image.

input_image_2
string | null

Path to the second input image.

input_image_3
string | null

Path to the third input image.

input_image_4
string | null

Path to the fourth input image.

seed
integer | null

Optional seed for reproducibility.

Example:

42

width
integer | null
default:0

Width of the image

Required range: x >= 64
height
integer | null
default:0

Height of the image

Required range: x >= 64
safety_tolerance
integer
default:2

Tolerance level for input and output moderation. Between 0 and 5, 0 being most strict, 5 being least strict.

Required range: 0 <= x <= 5
Example:

2

output_format
enum<string> | null
default:jpeg
Available options:
jpeg,
png
webhook_url
string<uri> | null

URL to receive webhook notifications

Required string length: 1 - 2083
webhook_secret
string | null

Optional secret for webhook signature verification

Response

Successful Response

id
string
required
polling_url
string
required
cost
number | null

Cost in credits for this request

input_mp
number | null

Input megapixels (2 decimal places)

output_mp
number | null

Output megapixels (2 decimal places)